package com.anli.config;

/**
 * @author: LI-CI-GAO
 * 作者: licigao
 * 日期: 2021/9/2  15:20
 * 描述:
 */

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

@Configuration
public class TestThreadPoolConfig {

    @Bean("testpool")
    public ThreadPoolExecutor getNewThreadPool(){

        ArrayBlockingQueue arrayBlockingQueue=new ArrayBlockingQueue(100000);

        ThreadPoolExecutor threadPoolExecutor=new ThreadPoolExecutor(5,5,10,TimeUnit.SECONDS,arrayBlockingQueue);

        return threadPoolExecutor;
    }

}
